/*Actions apply for dashboard*/

/*Remove unneeded functions for member*/
jQuery('#wp-admin-bar-wp-logo').remove();
jQuery('.ab-label').remove();
jQuery('#welcome-panel').remove();
jQuery('#dashboard-widgets-wrap').remove();
jQuery('#wpfooter').remove();
jQuery('#screen-meta-links').remove();
jQuery('#menu-posts').remove();
jQuery('#menu-posts-tutorials').remove();
jQuery('#menu-tools').remove();
jQuery('#wp-admin-bar-new-content').remove();
jQuery('#wp-admin-bar-comments').remove();
jQuery('#postcustom').remove();
jQuery('#categorydiv').remove();
jQuery('.update-nag').remove();

/*Show personal page URL*/
url = window.location.href;
if (url.indexOf('wp-admin/post-new.php') != -1) {
	if (url.indexOf('post_type=') == -1) {
		window.location.href = url + '?post_type=templates';
	}
}
if (url.indexOf('wp-admin/post-new.php') != -1) {
	if (url.indexOf('post_type=tutorials') != -1) {
		url = url.replace('tutorials', 'templates');
		window.location.href = url;
	}
}
if (url.indexOf('wp-admin/post-new.php') != -1) {
	if (url.indexOf('post_type=tutorial-items') != -1) {
		url = url.replace('tutorial-items', 'templates');
		window.location.href = url;
	}
}
jQuery(document).ready(function(){
	if (url.indexOf('wp-admin/profile.php') != -1) {
		user_name = jQuery('.username').text();
		jQuery('<a style="margin: 0 0 0 1em;text-decoration: none;font-size: 14px;font-weight: bold;" href="'+home_url+'/author/'+user_name+'">View your personal page</a>').insertAfter('#submit');
	}
});

